The present invention relates to data storage in direct access storage device systems and more particularly to a method for reducing errors that result when sufficient space on a storage volume cannot be allocated to a user of the system.
A problem frequently encountered by users of a computer system that utilizes a direct access storage device (DASD) occurs when space constraints prevent a data set from being initially allocated or extended on the storage device. This problem occurs because the user must estimate the maximum size of the data set to be stored on the direct access storage device system. If the system cannot allocate as much space as the user has requested, a space allocation error is returned to the user.
In many types of data set organizations, when a space allocation request is made, it must be allocated within a preset number of extents or sections. For example, a five extent limit means that a space request (e.g. one hundred cylinders) cannot span more than five extents or contiguous sections. This type of organizational constraint is a frequent cause of space allocation errors.
The present invention comprises a method and apparatus for reducing space allocation failures. In the method of the present invention, when a message is generated that an initial space request for a first amount of space on a DASD cannot be allocated, a preset limit on the number of extents that can be used to provide the first amount of space is changed. The preset limit (e.g. a five extent limit) is replaced with a revised limit on the number of extents. that can be used to provide the first amount of space. The revised limit is always greater than the preset limit.
At the same time the revised limit is being generated, the initial space request is reduced by a preset percentage to yield a revised space request. A new attempt is then made to allocate space on the first volume of the direct access storage device using the revised limit on the number of extents and the revised space request. If more than one DASD volume is available for accommodating a space request, then a plurality of volumes can be checked to locate a single volume on which to allocate the revised space request using the revised limit on the number of extents.
In a second embodiment of the present invention, before trying to allocate the initial space request on a single volume, an attribute (the volume count attribute) is checked to determine if authorization has been given to attempt to allocate the initial space request on more than one volume. If such authorization has been given, a first part of the initial space request is allocated on a first volume of DASD. If the whole initial space request has not been satisfied on the first volume, then a second part of the initial space request is allocated on a second volume of DASD. Additional parts of the initial space request are allocated on additional volumes of DASD, as necessary, until the initial space request has been satisfied.
If the initial space request could not be allocated by spreading it over a plurality of volumes, then the first extent limit is replaced with a second extent limit and the initial space request is reduced by a preset amount to yield the revised space request. An attempt is then made to allocate the revised space request by spreading it over the plurality of volumes.